package com.cheyun.netsalev3.utils

import com.cheyun.netsalev3.bean.AZItemEntity
import com.cheyun.netsalev3.bean.CarPinPaParam
import java.util.Comparator

/**
 * @author Michael
 * @date  2018/12/24 - 15:22.
 */
class LettersComparator : Comparator<AZItemEntity<CarPinPaParam>> {

    override fun compare(o1: AZItemEntity<CarPinPaParam>, o2: AZItemEntity<CarPinPaParam>): Int {
        return if (o1.sortLetters.equals("★") || o2.sortLetters.equals("#")) {
            -1
        } else if (o1.sortLetters.equals("#") || o2.sortLetters.equals("★")) {
            1
        } else {
            o1.sortLetters!!.compareTo(o2.sortLetters!!)
        }
    }

}
